package pages;

import core.TestBase;
import org.openqa.selenium.By;
import utils.Log4Test;

/**
 * Created by w on 07.07.14.
 */
public class HomePage extends TestBase{

    private String URL = "http://rozetka.com.ua/";

    protected By ItemToBeOpened= By.xpath(".//*[@id='head_banner_container']//li[@class=\"main-page-m-catalog-subl-i\"]/a[contains(text(),'Ноутбуки')]");

    public void open()
    {

        webDriver.get(URL);
        Log4Test.info("Open WebUrl " + URL);

    }

    public boolean isOpened()
    {
        return webDriver.getCurrentUrl().equals(URL);
    }


   public CommonNotebookPage clickTab(){
       Log4Test.info("Choose Tab 'Notebook' and Click");
       webDriver.findElement(ItemToBeOpened).click();
       return new CommonNotebookPage();
    }

}


